/******************************************************************************
COPYRIGHT 2012   : ATECH
Project          : 
Source File Name : driverE2.h
Group            : SoftWare Team
Author           : 
Date First Issued: 09/21/2012
********************************Documentation**********************************
Purpose -  This file is 
********************************RevisionHistory********************************
_______________________________________________________________________________
Date : MM/DD/YY    Release        Changes Description                  Author
Date : 09/21/2012    1.0                                                 
   
******************************************************************************/


#ifndef driverE2_h
#define driverE2_h


/* #include */ 

/* #define */ 
#define	EE_TOTAL_SIZE		    (256)
#define	EE_BLOCK_SIZE	    	(4)
#define	EE_CACHE_SIZE	    	(16)


#define E2_BUSY             (0)
#define E2_ERROR_ARG        (1)
#define E2_CMD_STARTED      (2)
#define E2_CMD_DONE         (3)
#define E2_TIMEOUT          (4)  



/* typedef */

typedef enum StatusE2Enum {
    E2_IDLE,
  	E2_WAIT,
    E2_ERASE,
    E2_WAITERASE,
    E2_WRITE,
    E2_WAITWRITE
    //E2_INI
} StatusE2;


/* typedef */
     

/* Variables */


/* Function prototypes */

/* static function prototypes */
void iniE2PROM(void);
void Erase_Sector_4Byte(UINT8 address);
void readE2(UINT8 *pBuf, UINT8 addr, UINT8 nBytes, UINT8 *pStatus);
void writeE2(UINT8 *pBuf, UINT8 addr, UINT8 nBytes, UINT8 *pStatus);  


/**********************end of driverE2.h**************************************/ 
#endif


/******************************************************************************
 Revision Notes:

For each change to this file, be sure to record:
1. Who made the change and when the change was made.
2. Why the change was made and the intended result.

  Date     By     Reason For Change
mm/dd/yy  XXX     -----------------

******************************************************************************/